﻿namespace LxCore
{
    public class TextReaderOnString : ITextReader
    {
        public TextReaderOnString(string text)
        {
            this.json = text;
        }
        protected string json;
        protected int index = 0;//指向下一个要读取的char

        public bool EndOfStream()
        {
            return index >= json.Length;
        }
        public char Peek()
        {
            return json[index];
        }
        public char Read()
        {
            return json[index++];
        }
    }
}
